package appx.craft.droid.ui;

import java.util.ArrayList;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.Toast;
import appx.craft.droid.R;
import appx.craft.droid.bean.CellBean;
import appx.craft.droid.bean.TableBean;
import appx.craft.droid.uc.ITableCellListener;
import appx.craft.droid.uc.TableListViewAdapter;
import appx.craft.droid.utils.Log;

public class FeedSettingsActivity extends Activity implements ITableCellListener {
	
	private final String TAG = FeedSettingsActivity.class.getCanonicalName();
	private ListView table_list_view;
	private TableListViewAdapter mListViewAdapter;
	private ArrayList<TableBean> mArrayTableList;
	private ArrayList<CellBean> mArrayCellList;
	CellBean mCellTempBean;
	TableBean mcatchBean;
	
	@Override
	protected void onCreate(Bundle saveInstance) {
		super.onCreate(saveInstance);
		Log.d(TAG,"[onCreate ]");
		setContentView(R.layout.activity_feed_settings);
		
		mArrayTableList = new ArrayList<TableBean>();
		
		
		mcatchBean = new TableBean();
		mcatchBean.setCellHeader(getResources().getString(R.string.lbl_title_friends));
		 
		mArrayCellList  = new ArrayList<CellBean>();
		mCellTempBean = new CellBean();
		mCellTempBean.setRowID(""+0);
		mCellTempBean.setRowText(getResources().getString(R.string.lbl_find_people));
		mArrayCellList.add(mCellTempBean);
		
		
		mCellTempBean = new CellBean();
		mCellTempBean.setRowID(""+1);
		mCellTempBean.setRowText(getResources().getString(R.string.lbl_invite_via_text));
		mArrayCellList.add(mCellTempBean);
		
		mCellTempBean = new CellBean();
		mCellTempBean.setRowID(""+2);
		mCellTempBean.setRowText(getResources().getString(R.string.lbl_invite_via_email));
		mArrayCellList.add(mCellTempBean);
			
		mcatchBean.setmArrayList_cellBean(mArrayCellList);
		
		 
		mArrayTableList.add(mcatchBean);	
		
		//*********************************************************************************
		
		mcatchBean = new TableBean();
		mcatchBean.setCellHeader(getResources().getString(R.string.lbl_social_networks));
	 
		mArrayCellList  = new ArrayList<CellBean>();
		
		mCellTempBean = new CellBean();
		mCellTempBean.setRowID(""+0);
		mCellTempBean.setRowText(getResources().getString(R.string.lbl_twitter));
		mArrayCellList.add(mCellTempBean);
			
		
//		mCellTempBean = new CellBean();
//		mCellTempBean.setRowID(""+1);
//		mCellTempBean.setRowText(getResources().getString(R.string.lbl_facebook));
//		mArrayCellList.add(mCellTempBean);
		
		
		mcatchBean.setmArrayList_cellBean(mArrayCellList);
		
		 
		mArrayTableList.add(mcatchBean);
		
		//*********************************************************************************
		
		
		
		mcatchBean = new TableBean();
		mcatchBean.setCellHeader(getResources().getString(R.string.lbl_support));
	 
		mArrayCellList  = new ArrayList<CellBean>();
		
		mCellTempBean = new CellBean();
		mCellTempBean.setRowID(""+0);
		mCellTempBean.setRowText(getResources().getString(R.string.lbl_feedback));
		mArrayCellList.add(mCellTempBean);
			
//		mCellTempBean = new CellBean();
//		mCellTempBean.setRowID(""+1);
//		mCellTempBean.setRowText(getResources().getString(R.string.lbl_terms_of_service));
//		mArrayCellList.add(mCellTempBean);
		
		mcatchBean.setmArrayList_cellBean(mArrayCellList);
		
		 
		mArrayTableList.add(mcatchBean);
		
	
		
		table_list_view =(ListView)findViewById(R.id.table_list_view);
		
		mListViewAdapter = new TableListViewAdapter(FeedSettingsActivity.this);
		table_list_view.setAdapter(mListViewAdapter);
		
		mListViewAdapter.addTableItems(mArrayTableList);
		
	}
	
	@Override
	protected void onStart() {
		super.onStart();
		Log.d(TAG,"[onStart ]");
	}
	
	@Override
	protected void onStop() {
		super.onStop();
		Log.d(TAG,"[onStop]");
	}
	
	@Override
	protected void onDestroy() {
		super.onDestroy();
		Log.d(TAG,"[onDestroy]");
	}
	
	@Override
	protected void onPause() {
		super.onPause();
		Log.d(TAG,"[onPause]");
	}

	@Override
	public void onTableCellItemClick(int vCellPosition, int vPosition) {
		Toast.makeText(getApplicationContext(),"[cell Item ]"+ vCellPosition + " [ Cell Number ]"+ vPosition,Toast.LENGTH_SHORT).show();
		
	}

}
